#include "ServoChief.h"

ServoChief::ServoChief()
{}

ServoChief::~ServoChief()
{}

void ServoChief::attach(uint8_t pin)
{
  servo.attach(pin);
}

void ServoChief::turnLeft(uint8_t v)
{
  angle_ = kMiddlePos - v;
  servo.write(angle_);
  delay(delayTime);
}

void ServoChief::turnRight(uint8_t v)
{
  angle_ = kMiddlePos + v;
  servo.write(angle_);
  delay(delayTime);
}

void ServoChief::returnBack()
{
  angle_ = kMiddlePos;
  servo.write(angle_);
  delay(delayTime);
}

uint8_t ServoChief::angle()
{
  return angle_;
}
